import axios from 'axios'
import $store from '@/store/index'


const baseURL="http://localhost:3000"

let ajaxTimer = 0;
export function request(config) {
    const install = axios.create({
        baseURL,
        timeout: 2000
    });
    install.interceptors.request.use(data => {
        ajaxTimer++;
        return data;
    }),err => {
        return err
    }

    install.interceptors.response.use(data => {
        ajaxTimer--;
        return data
    }), err => {
        return err
    }

    return install(config)

} 
